

//定义一个学生类（Student），包含姓名（name）和成绩（score）属性。提供一个静态方法来找
//        出最高分的学生，并提供getter和setter方法。

package Job.thirtyFive;

public class Student {
    private String name;
    private double score;

    public Student(String name, double score) {
        this.name = name;
        this.score = score;
    }
    public static Student TopStudent(Student[] students) {
        Student topStudent = students[0];
        for (Student student : students) {
            if (student.getScore() > topStudent.getScore()) {
                topStudent = student;
            }
        }
        return topStudent;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }
}
